﻿using SqlSugar;
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations.Schema;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Blog.Model.Entitys
{
    /// <summary>
    /// 记忆碎片
    /// </summary>
    [SugarTable("Memento")]
    public class Memento : EntityBase
    {
        /// <summary>
        /// 标题
        /// </summary>
        [SugarColumn(ColumnName = "Title", IsNullable = false, Length = 100)]
        public string Title { get; set; }

        /// <summary>
        /// 内容
        /// </summary>
        [SugarColumn(ColumnName = "DebrisContent", IsNullable = false)]
        public string DebrisContent { get; set; }

        /// <summary>
        /// 封面图片
        /// </summary>
        [SugarColumn(ColumnName = "CoverImg", IsNullable = false, Length = 200)]
        public string CoverImg { get; set; }

        /// <summary>
        /// 排序
        /// </summary>
        [SugarColumn(ColumnName = "Sort", IsNullable = false)]
        public int Sort { get; set; } = 1;

        /// <summary>
        /// 是否展示
        /// </summary>
        [SugarColumn(ColumnName = "IsShow", IsNullable = false)]
        public bool IsShow { get; set; }

        /// <summary>
        /// 标签
        /// </summary>
        public string TagId { get; set; }

        /// <summary>
        /// 标签
        /// </summary>
        [ForeignKey("TagId")]
        [Navigate(NavigateType.OneToMany, nameof(TagId))]
        public virtual List<Tag> Tags { get; set; }

        /// <summary>
        /// 浏览量
        /// </summary>
        [SugarColumn(ColumnName = "PV")]
        public long PV { get; set; }

        /// <summary>
        /// 点赞量
        /// </summary>
        [SugarColumn(ColumnName = "Numberlikes")]
        public long Numberlikes { get; set; }
    }
}
